package com.audaque.springboot.foshanupload.web.raspcloud.controller.ext;

import com.audaque.springboot.foshanupload.web.raspcloud.req.ext.UserCreateReq;
import com.audaque.springboot.foshanupload.web.raspcloud.req.ext.UserUpdateReq;
import com.audaque.springboot.foshanupload.web.raspcloud.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


/**
 * <p>
 * 用户 前端控制器
 * </p>
 *
 * @author chinaben
 * @since 2025-07-02
 */
@RestController

@Api(value = "用户 前端控制器")

@RequestMapping("/userExt")
public class UserExtController {


    @Autowired
    private IUserService iUserService;


    @PostMapping(value = "/create")
    @ApiOperation(value = "用户 创建")
    public void create(@RequestBody @Valid UserCreateReq params) throws Exception {
        iUserService.save(params);
    }

    @PostMapping(value = "/update")
    @ApiOperation(value = "用户 更新")
    public void update(@RequestBody @Valid UserUpdateReq params) {
        iUserService.updateById(params);
    }



}
